<template>
  <div>
    <el-row>
      <p class="pinformation">脚本配置列表</p>
      <p class="totalStyle">共 {{ tableTable.length }} 条数据</p>
      <el-row style="padding-bottom: 5px; margin-left: 15px">
        <el-button link type="success" icon="plus">新增</el-button>
      </el-row>
    </el-row>
    <el-table class="business" v-loading="loading" :data="tableTable" ref="mainTableRef">
      <el-table-column label="脚本名称" align="center" prop="tableCode" />
      <el-table-column label="对应字段" align="center" prop="tableCode" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template #default="scope">
          <el-button link type="success">编辑</el-button>
          <el-button link type="danger">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div style="height: 30px"></div>
  </div>
</template>

<script setup>
const { proxy } = getCurrentInstance();
const propertiesForm = ref({});

const loading = ref(false);
const tableTable = ref([]);

const heightParams = ref([{ tableName: "main", bottomHeight: 61 }]);

function getTableHeight() {
  proxy.adaptiveHeight(proxy, heightParams.value);
}
onMounted(() => {
  nextTick(() => {
    getTableHeight();
    window.addEventListener("resize", getTableHeight);
  })
})
onUpdated(() => {
  nextTick(function () {
    getTableHeight();
  });
});
onBeforeUnmount(() => {
  window.removeEventListener("resize", getTableHeight);
});
</script>
